package com.smf.lsc.authorization.security.service;

import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.authentication.dao.DaoAuthenticationProvider;
import org.springframework.security.core.AuthenticationException;
import org.springframework.security.core.userdetails.UserDetails;

/**
 * 取消密码校验
 * Created on 2021/11/19.
 *
 * @author ln
 * @since 1.0
 */

public class MyAuthenticationProvider extends DaoAuthenticationProvider {
    @Override
    public boolean supports(Class<? extends Object> authentication) {
//        return (authentication.getSimpleName().equals(UsernamePasswordAuthenticationToken.class.getSimpleName()));
    	return (authentication.isAssignableFrom(UsernamePasswordAuthenticationToken.class));
    }


    @Override
    protected void additionalAuthenticationChecks(UserDetails userDetails, UsernamePasswordAuthenticationToken authentication) throws AuthenticationException {
    }

}
